package com.leapp.sk.sever.personal

import android.content.Context
import com.example.util.ObjectProcessingUtil
import com.leapp.sk.bean.PersonalMineDataEntity
import com.leapp.sk.bean.response.personal.PersonalMineResponseEntity
import com.leapp.sk.viewdelegate.MyDelegate

/**
 * 我的首页逻辑处理类
 * @author  chaohaipeng  on 2018/8/21.
 */
class MineSever {
    private object mHolder {
        val instance = MineSever()
    }
    companion object {
        fun getInstance(): MineSever {
            return mHolder.instance
        }
    }

    /**
     * 绑定数据
     */
    fun binderData(context: Context, viewDelegate: MyDelegate, obj: PersonalMineResponseEntity?){
        val personalMineDataEntity: PersonalMineDataEntity = ObjectProcessingUtil.objMandatoryConversionClass(obj?.data, PersonalMineDataEntity::class.java)
        viewDelegate?.setData(context,personalMineDataEntity)
    }

}